package com.example.demo.mapper;

import com.example.demo.entity.PersonEvent;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PersonEventMapper {
    List<PersonEvent> selectAll();

    @Select("SELECT * FROM `person_event` WHERE event_id = #{eventId}")
    PersonEvent selectById(Long eventId);

    void insert(PersonEvent event);

    void updateById(PersonEvent event);

    @Delete("DELETE FROM `person_event` WHERE event_id = #{eventId}")
    void deleteById(Long eventId);

    @Select("SELECT * FROM `person_event` WHERE person_id = #{personId}")
    List<PersonEvent> selectByPersonId(Long personId);
}